/* Diary.css */
.diary-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.search-button {
  padding: 8px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.search-button:hover {
  background: #0056b3;
}

.content-wrapper {
  display: grid;
  gap: 30px;
}

.diary-section, .summary-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.loading-indicator {
  display: inline-block;
  margin-left: 15px;
  color: #666;
  font-size: 0.9em;
}

.entry-list, .summary-grid {
  display: grid;
  gap: 15px;
}

.entry-card, .summary-card {
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 6px;
  transition: transform 0.2s;
}

.entry-card:hover {
  transform: translateY(-2px);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #666;
}

.entry-date {
  font-weight: bold;
}

.entry-mood {
  font-size: 0.9em;
}

.summary-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.summary-card h4 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.summary-content {
  line-height: 1.6;
  color: #444;
}

.empty-message {
  padding: 20px;
  text-align: center;
  color: #999;
}

/* 弹窗遮罩层 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* 弹窗内容 */
.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.diary-content {
  line-height: 1.6;
  white-space: pre-wrap; /* 保留换行格式 */
}

/* 日记列表容器 */
.diary-list {
  margin-top: 1rem;
  border-radius: 8px;
  background: #f8f9fa;
}

/* 单个日记卡片 */
.diary-card {
  padding: 1rem;
  margin-bottom: 1rem;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  gap: 1rem;
}

/* 日期角标 */
.date-badge {
  min-width: 50px;
  height: 50px;
  background: #4a90e2;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* 内容区域 */
.content-box {
  flex: 1;
  padding: 0.5rem;
  line-height: 1.6;
  white-space: pre-wrap; /* 保留换行 */
}

/* 空状态提示 */
.empty-state {
  padding: 2rem;
  text-align: center;
  color: #666;
}

/* 错误提示 */
.error-alert {
  background: #ffe3e3;
  color: #c00;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}